<?php 
if( !empty($uploaderrors)){ foreach ($uploaderrors as $error )  {?>
<div class=' grid_2 error aligncenter' >
	<?php echo $error?>
</div>
<?php } }?>
<?php
$attributes = array('class' => 'uploadform', 'id' => 'imageuploadform');
$hidden = array('upload_submitted' => true );
echo form_open_multipart($form_address, $attributes,$hidden); ?>
<?php
if( empty($filecreated) )$filecreated = FALSE;
if(!empty($filecreated) && !empty($filecreated)&& !empty($uploadImg)){
	$html = <<<EOD
        <script type="text/javascript">
		$(document).ready(
				function AddController(  ){
					controller = window.parent.RegisterChild();
					param1 = { 'id':$uploadImg->id,'src':'$uploadImg->location','height':'$uploadImg->height','width':'$uploadImg->width','title':'$uploadImg->title','short_desc':'$uploadImg->short_desc'};
					controller.addImageToCat( param1 );
				}
			);
		</script>
EOD;
echo $html;
}
?>
<script type="text/javascript">
$(document).ready(
	function AddController(  ){
		controller = window.parent.RegisterChild();
	}
);
</script>
<h3 class="aligncenter">Upload Image</h3>
<div class="grid_3 nicebutton" >
<input type="file" name="imgupload" size="12"  />
</div>
<div class="grid_3 nicebutton margin_top20 alignright" >
<input type="submit" value="upload" />
</div>
</form>